package com.whut.whw.main;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentTransaction;
import android.view.ViewGroup;

import java.util.List;

/**
 * <pre>
 *     author : 杨丽金
 *     e-mail : xxx@xx
 *     time   : 2017/05/18
 *     desc   : MainActivity中的ViewPager的适配器
 *     version: 1.0
 * </pre>
 */
public class MyViewpagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragmentList;

    public MyViewpagerAdapter(FragmentManager fm, List<Fragment> fragmentList) {
        super(fm);
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }
}
